package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class Input_OutputStream_Reader_Writer {
    public static void main(String[] args) {
        try(InputStream inputStream=new FileInputStream("./test.txt.txt")) {

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    public static void main1(String[] args) {
        InputStream inputStream=null;
        try {
            inputStream = new FileInputStream("./test.txt.txt");//InputStream是个抽象类,不能直接new
        } catch(IOException e){
            e.printStackTrace();
        } finally {
            try {
                inputStream.close();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
